<template>
<view class="dynamic-company">
	<view v-if="innerType == 'company'" class="item1 fboxRow" @click="$pageTo('/Detail?share=0&dynamicId='+innerData.dynamicId)">
		<view class="pic">
			<image class="inner img_bg" :src="innerData.thumbnail" mode="aspectFill"></image>
		</view>
		<view class="fboxCol flex1">
			<view class="fboxRow Ycenter">
				<view class="flex1 lh44 font-ell1 name font32">{{innerData.dynamicName}}</view>
				<!-- <view class="action">
					<u-icon name="more-dot-fill" color="#6B707C" size="16"></u-icon>
				</view> -->
			</view>
			<view class="info lh40 font28 color-38383D font-ell2">{{innerData.dynamicDetail ? innerData.dynamicDetail.replace(/<[^>]+>/g,"") : ''}}</view>
			<view class="time fboxRow Xend mt12 font24">{{ dateFormat(innerData.gmtCreate)}}</view>
		</view>
	</view>
	<view v-if="innerType == 'index'" class="item2">
		<view class="fboxRow Ycenter" @click="$pageTo('/businessCard?isScan=1&id=' + innerData.companyId)">
			<image class="logo img_bg" :src="innerData.companyLogo" mode="aspectFill"></image>
			<view class="flex1 name font30 lh44">{{ innerData.companyName }}</view>
			<!-- <view class="action"><u-icon name="more-dot-fill" color="#6B707C"></u-icon></view> -->
		</view>
		<view @click="$pageTo('/Detail?dynamicId=' + innerData.dynamicId)">
			<view class="title font-ell2 font32 mt32 lh44">{{ innerData.dynamicName }}</view>
			<view class="content color-38383D font-w300 font-ell3 font30 lh44">{{ innerData.dynamicDetail.replace(/<[^>]+>/g, '') }}</view>
			<view class="pic mt30"><image class="pic img_bg" :src="innerData.thumbnail" mode="aspectFill"></image></view>
			<view class="info fboxRow Ycenter lh38 font26 font-w300">
				<!-- <view class="flex1 time">{{ innerData.gmtCreate }}</view> -->
				<!-- <view class="fboxRow Ycenter ml24">
					<text class="bwfont bw-Vector2"></text>
					<text class="time">{{ innerData.browseCount }}</text>
				</view>
				<view class="fboxRow Ycenter ml24">
					<text class="bwfont bw-a-zu3304"></text>
					<text class="time">{{ innerData.commentNum }}</text>
				</view>
				<view class="fboxRow Ycenter ml24">
					<text  class="bwfont bw-Vector3" :style="{color: innerData.isLike ? '#E8CDA7' : ''}" ></text>
					<text class="time">{{ innerData.likeNum }}</text>
				</view> -->
				<view class="flex1 fboxRow Ycenter">
					<view class="time">{{ dateFormat(innerData.gmtCreate) }}</view>
				</view>
				<view class="fboxRow Ycenter ml24">
					<text class="bwfont bw-Vector2"></text>
					<text class="time">{{ innerData.browseCount || '浏览' }}</text>
				</view>
				<view class="fboxRow Ycenter ml24" @tap.stop="goPage('dynamicDetails')">
					<text class="bwfont bw-a-zu3304"></text>
					<text class="time">{{ innerData.commentNum || '评论' }}</text>
				</view>
				<view class="fboxRow Ycenter ml24">
					<text  class="bwfont bw-Vector3" :style="{color: innerData.isLike ? '#E8CDA7' : ''}" ></text>
					<text class="time">{{ innerData.likeNum || '点赞' }}</text>
				</view>
			</view>
		</view>
	</view>
</view>
</template>

<script>
import {dateFormat} from '@/static/js/common.js';
export default {
	props: {
		innerData: {
			type: Object,
			defaul: () => {
				return {}
			}
		},
		innerType:{
			type: String,
			default: 'company' // company 企业名片，index 首页
		}
	},
	data() {
		return {dateFormat}
	},
	methods: {
	}
}
</script>

<style lang="scss" scoped>
.dynamic-company .item1{padding: 24rpx; margin-top: 24rpx; background-color: var(--viewBgColor);border-radius: 12rpx;overflow: hidden;}
.dynamic-company .item1 .name {font-weight: 500;}
.dynamic-company .item1 .pic {margin-right: 24rpx;}
.dynamic-company .item1 .pic .inner {width: 200rpx;height: 160rpx;border-radius: 8rpx}
.dynamic-company .item1 .info {color:var(--contentFontDarkColor);font-weight: 300;height: 80rpx;}
.dynamic-company .item1 .time {color:var(--contentFontFourColor);}

.dynamic-company .item2{padding: 20rpx 20rpx 28rpx; margin-bottom: 24rpx; background-color: var(--viewBgColor);border-radius: 12rpx;overflow: hidden;}
.dynamic-company .item2 .logo {margin-right: 16rpx;width: 80rpx;height: 80rpx;border-radius: 5rpx;}
.dynamic-company .item2 .pic {width:100%;height: 352rpx;background: var(--viewBgColor);border-radius: 12rpx;}
.dynamic-company .item2 .info{margin-top: 26rpx; height: 40rpx;}
.dynamic-company .item2 .info .time {color: var(--contentFontFourColor);}
.dynamic-company .item2 .info .bwfont {margin-right: 8rpx;font-size: 24rpx;color: var(--contentFontFourColor);}


</style>